package org.manon.json.filter;

import java.util.Collection;
import java.util.Iterator;
import java.util.Set;

abstract class BasicSet implements Set<String> {

	
	static final BasicSet TRUE = new BasicSet() {
		public boolean contains(Object o) {
			return true;
		}
	};
	
	
	static final BasicSet FALSE = new BasicSet() {
		public boolean contains(Object o) {
			return false;
		}
	};
	
	static final BasicSet createExceptSet(final Set<String> set) {
		return new BasicSet() {
			public boolean contains(Object o) {
				return !set.contains(o);
			}
		};
	}
	
	/**
	 * @see java.util.Set#size()
	 */
	public int size() {
		throw new IllegalStateException();
	}

	/**
	 * @see java.util.Set#isEmpty()
	 */
	public boolean isEmpty() {
		return false;
	}

	
	/**
	 * @see java.util.Set#iterator()
	 */
	public Iterator<String> iterator() {
		throw new IllegalStateException();
	}

	/**
	 * @see java.util.Set#toArray()
	 */
	public Object[] toArray() {
		throw new IllegalStateException();
	}

	/**
	 * @see java.util.Set#toArray(T[])
	 */
	public <T> T[] toArray(T[] a) {
		throw new IllegalStateException();
	}

	/**
	 * @see java.util.Set#add(java.lang.Object)
	 */
	public boolean add(String e) {
		throw new IllegalStateException();
	}

	/**
	 * @see java.util.Set#remove(java.lang.Object)
	 */
	public boolean remove(Object o) {
		throw new IllegalStateException();
	}

	/**
	 * @see java.util.Set#containsAll(java.util.Collection)
	 */
	public boolean containsAll(Collection<?> c) {
		throw new IllegalStateException();
	}

	/**
	 * @see java.util.Set#addAll(java.util.Collection)
	 */
	public boolean addAll(Collection<? extends String> c) {
		throw new IllegalStateException();
	}

	/**
	 * @see java.util.Set#retainAll(java.util.Collection)
	 */
	public boolean retainAll(Collection<?> c) {
		throw new IllegalStateException();
	}

	/**
	 * @see java.util.Set#removeAll(java.util.Collection)
	 */
	public boolean removeAll(Collection<?> c) {
		throw new IllegalStateException();
	}

	/**
	 * @see java.util.Set#clear()
	 */
	public void clear() {
		throw new IllegalStateException();
	}

	
}
